Add back hvm guest apm support and fixed the original apm issues to
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 19 Mar 2006 11:41:28 +0000 (12:41 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 19 Mar 2006 11:41:28 +0000 (12:41 +0100)
make "halt -p" and "shutdown -h now" work. Also added apm 0x05 CPU
idle, 0x08 Enable PM and 0x0f apm engage/disengage subfunctions.

Signed-off-by: Winston Wang <winston.l.wang@intel.com>
tools/firmware/rombios/apmbios.S
tools/firmware/rombios/rombios.c

index d8ac16084825367292aec2ff151714c6126e7c48..df8e106129e244414a0608bdf0aa8de3d0be4daf 100644 (file)
@@ -217,14 +217,22 @@ APMSYM(03):
 ; APM interface disconnect
 APMSYM(04):
   cmp al, #0x04
+  jne APMSYM(05)
+  jmp APMSYM(ok)
+
+;-----------------
+; APM cpu idle
+APMSYM(05):
+  cmp al, #0x05
   jne APMSYM(07)
+  hlt
   jmp APMSYM(ok)
 
 ;-----------------
 ; APM Set Power State
 APMSYM(07):
   cmp al, #0x07
-  jne APMSYM(0a)
+  jne APMSYM(08)
   
   cmp bx, #1
   jne APMSYM(ok)
@@ -267,6 +275,14 @@ APMSYM(07_standby):
   pop edx
   jmp APMSYM(ok)
 
+;-----------------
+; APM Enable / Disable
+APMSYM(08):
+  cmp al, #0x08
+  jne APMSYM(0a)
+
+  jmp APMSYM(ok)
+
 ;-----------------
 ; Get Power Status
 APMSYM(0a):
@@ -297,13 +313,32 @@ APMSYM(0b):
 ; APM Driver Version
 APMSYM(0e):
   cmp al, #0x0e
-  jne APMSYM(unimplemented)
+  jne APMSYM(0f)
   
   mov ah, #1
   mov al, #2
   
   jmp APMSYM(ok)
 
+;-----------------
+; APM Engage / Disengage
+APMSYM(0f):
+  cmp al, #0x0f
+  jne APMSYM(10)
+
+  jmp APMSYM(ok)
+
+;-----------------
+; APM Get Capabilities
+APMSYM(10):
+  cmp al, #0x10
+  jne APMSYM(unimplemented)
+
+  mov bl, #0
+  mov cx, #0
+
+  jmp APMSYM(ok)
+
 ;-----------------
 APMSYM(ok):
   popf
index 397b9d820443978118047e709c9b854573b9512b..df3db61773c88fca91c45ffe4f82009fe81e117b 100644 (file)
 #define BX_SUPPORT_FLOPPY 1
 #define BX_FLOPPY_ON_CNT 37   /* 2 seconds */
 #define BX_PCIBIOS       1
-#define BX_APM           0
+#define BX_APM           1
 
 #define BX_USE_ATADRV    1
 #define BX_ELTORITO_BOOT 1